<template>
    <div class="instanceSearchContainer">
        <span class="inputLabel">容器名称</span>
        <el-input v-model="containerInstanceDetailSearchData.dockerName" placeholder="容器名称" class="searchInfoInput"></el-input>

        <span class="inputLabel">容器ID</span>
        <el-input v-model="containerInstanceDetailSearchData.dockerContainerId" placeholder="容器ID" class="searchInfoInput"></el-input>

        <el-button type="primary" icon="SearchOutlined" :loading="searchLoading" class="searchButtonClass" @click="queryDetailInfo()">搜索</el-button>
        <el-button icon="RedoOutlined" @click="resetInput()">重置</el-button>
    </div>
</template>

<script>
import {containerInstanceDetailInfo} from "@/request/container";

export default {
    name: "ContainerInstanceDetailSearch",
    data() {
        return {
            searchLoading: false
        }
    },
    methods: {
        queryDetailInfo() {
            this.searchLoading = true
            containerInstanceDetailInfo(this.containerInstanceDetailSearchData).then(res => {
                this.$store.state.containerInstanceDetailDataList = res.data;
                this.searchLoading = false
            }).catch(res => {
                this.searchLoading = false
            })
        },
        resetInput() {
            this.$store.state.containerInstanceDetailSearchData = {}
        }
    },
    computed: {
        containerInstanceDetailSearchData() {
            return this.$store.state.containerInstanceDetailSearchData;
        }
    }
}
</script>

<style scoped lang="less">
.instanceSearchContainer {
    width: 100%;
    height: 10%;
    .searchInfoInput {
        width: 15%;
        padding-left: 1%;
    }
    .inputLabel {
        padding-left: 1%;
        font-weight: 700;
        font-size: 15px;
        color: #606266;
    }
    .searchButtonClass {
        margin-left: 1%;
    }
}
</style>